From: Sebastian Ramacher Date: Sat, 11 Nov 2023 23:29:00 +0000 (+0100) Subject: avcodec/avfft: initialize to 0 to avoid segfaults when freeing ctx2 X-Git-Tag: archive/raspbian/7%8.1-3+rpi1~1^2^2^2^2^2^2^2^2^2^2~2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/success//%22mailto:kde%40ewsoftware.de/%22/%22http:/www.example.com/cgi/success/%22mailto:kde%40ewsoftware.de/%22?a=commitdiff_plain;h=0800c11a259278c2fabe54bae3ef0d1f9ec6650d;p=ffmpeg.git avcodec/avfft: initialize to 0 to avoid segfaults when freeing ctx2 Gbp-Pq: Name 0001-avcodec-avfft-initialize-to-0-to-avoid-segfaults-whe.patch --- diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index fb635abf..3ef076d2 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -46,7 +46,7 @@ FFTContext *av_fft_init(int nbits, int inverse) { int ret; float scale = 1.0f; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -85,7 +85,7 @@ FFTContext *av_mdct_init(int nbits, int inverse, double scale) { int ret; float scale_f = scale; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -146,7 +146,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) if (trans != IDFT_C2R && trans != DFT_R2C) return NULL; - s = av_malloc(sizeof(*s)); + s = av_mallocz(sizeof(*s)); if (!s) return NULL; @@ -199,7 +199,7 @@ DCTContext *av_dct_init(int nbits, enum DCTTransformType inverse) [DST_I] = AV_TX_FLOAT_DST_I, }; - AVTXWrapper *s = av_malloc(sizeof(*s)); + AVTXWrapper *s = av_mallocz(sizeof(*s)); if (!s) return NULL;